Kameleon-Plus
0.3.2
Main Page
Modules
Namespaces
Classes
Files
File List
File Members
src
ccmc
Point.h
Go to the documentation of this file.
1
/*
2
* Point.h
3
*
4
* Created on: Apr 21, 2009
5
* Author: David Berrios
6
*/
7
8
#ifndef POINT_H_
9
#define POINT_H_
10
#include <iostream>
11
#include <sstream>
12
#include <string>
13
#include <boost/lexical_cast.hpp>
14
15
namespace
ccmc
16
{
23
template
<
class
T>
24
class
Point
25
{
26
public
:
27
Point
();
28
Point
(T&
c0
, T&
c1
, T&
c2
);
29
void
setComponents
(T& c1, T& c2, T& c3);
30
const
T&
c0
();
31
const
T&
c1
();
32
const
T&
c2
();
33
std::string
toString
();
34
virtual
~Point
();
35
36
protected
:
37
T
components
[3];
38
39
};
40
44
template
<
class
T>
45
Point<T>::Point
()
46
{
47
48
}
49
50
template
<
class
T>
51
Point<T>::Point
(T& c0, T& c1, T& c2)
52
{
53
components[0] = c0;
54
components[1] = c1;
55
components[2] = c2;
56
}
57
58
template
<
class
T>
59
const
T&
Point<T>::c0
()
60
{
61
return
components[0];
62
}
63
64
template
<
class
T>
65
const
T&
Point<T>::c1
()
66
{
67
return
components[1];
68
}
69
70
template
<
class
T>
71
const
T&
Point<T>::c2
()
72
{
73
return
components[2];
74
}
75
76
template
<
class
T>
77
void
Point<T>::setComponents
(T& c0, T& c1, T& c2)
78
{
79
components[0] = c0;
80
components[1] = c1;
81
components[2] = c2;
82
}
83
84
template
<
class
T>
85
Point<T>::~Point
()
86
{
87
88
}
89
90
template
<
class
T>
91
std::string
Point<T>::toString
()
92
{
93
std::string temp =
"("
+ boost::lexical_cast<std::string>(components[0]) +
","
+ boost::lexical_cast<
94
std::string>(components[1]) +
","
+ boost::lexical_cast<std::string>(components[2]) +
")"
;
95
return
temp;
96
97
}
98
99
}
100
101
#endif
/* POINT_H_ */
Generated on Wed Apr 16 2014 18:34:46 for Kameleon-Plus by
1.8.3